/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package asja.dao;

import asja.bd.Conexao;
import asja.modelo.ExemploModelo;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;

/**
 *
 * @author Alice
 */
public class ExemploDao {
    
    private Connection conecta;
    
    public ExemploDao() throws SQLException {
        
        this.conecta = Conexao.getConnection();
    }
    
    
    
    // método para adicionar usuário do sistema.
    public void adiciona(ExemploModelo in) throws SQLException{
     String adi= "insert into teste (nome) values(?);";
     
     PreparedStatement stm = conecta.prepareStatement(adi); 
     stm.setString(1, in.getNome());
     
     stm.execute(); //executa o comando para salvar no banco;
     stm.close();
   
    }
    
    
}
